home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DRenderer.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  41.6 KB  |  1,145 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DRenderer.p
  3.  
  4.      Contains:    Q3Renderer types and routines                                          
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DRenderer;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DRENDERER__}
  28. {$SETC __QD3DRENDERER__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DRendererIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QD3DSET__}
  38. {$I QD3DSet.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QD3DVIEW__}
  41. {$I QD3DView.p}
  42. {$ENDC}
  43.  
  44. {$IFC TARGET_OS_MAC }
  45. {$IFC UNDEFINED __EVENTS__}
  46. {$I Events.p}
  47. {$ENDC}
  48. {$ENDC}  {TARGET_OS_MAC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN POWER}
  53. {$LibExport+}
  54.  
  55. {*****************************************************************************
  56.  **                                                                             **
  57.  **                            User Interface Things                             **
  58.  **                                                                             **
  59.  ****************************************************************************}
  60. {$IFC TARGET_OS_MAC }
  61. {
  62.  *  A callback to an application's event handling code. This is needed to    
  63.  *  support movable modal dialogs. The dialog's event filter calls this      
  64.  *  callback with events it does not handle.                                 
  65.  *  If an application handles the event it should return kQ3True.            
  66.  *  If the application does not handle the event it must return kQ3False and 
  67.  *  the dialog's event filter will pass the event to the system unhandled.   
  68.  }
  69.  
  70. TYPE
  71.     TQ3MacOSDialogEventHandler = ProcPtr;  { FUNCTION TQ3MacOSDialogEventHandler((CONST)VAR event: EventRecord): TQ3Boolean; C; }
  72.  
  73.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  74.     TQ3DialogAnchor = RECORD
  75.         clientEventHandler:        TQ3MacOSDialogEventHandler;
  76.     END;
  77.  
  78. {$ELSEC}
  79. {$IFC TARGET_OS_WIN32 }
  80.  
  81. TYPE
  82.     TQ3DialogAnchor = RECORD
  83.         ownerWindow:            HWND;
  84.     END;
  85.  
  86. {$ELSEC}
  87.  
  88. TYPE
  89.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  90.     TQ3DialogAnchor = RECORD
  91.         notUsed:                Ptr;                                    {  place holder  }
  92.     END;
  93.  
  94. {$ENDC}
  95. {$ENDC}
  96.  
  97. {*****************************************************************************
  98.  **                                                                             **
  99.  **                            Renderer Functions                                 **
  100.  **                                                                             **
  101.  ****************************************************************************}
  102. FUNCTION Q3Renderer_NewFromType(rendererObjectType: TQ3ObjectType): TQ3RendererObject; C;
  103. FUNCTION Q3Renderer_GetType(renderer: TQ3RendererObject): LONGINT; C;
  104.  
  105.  
  106. {
  107.  *    Non-blocking, flush all buffered graphics to rasterizer. May or
  108.  *    may not update the draw context.
  109.  *    
  110.  *    This function has been replaced by Q3View_Flush
  111.  }
  112. FUNCTION Q3Renderer_Flush(renderer: TQ3RendererObject; view: TQ3ViewObject): TQ3Status; C;
  113. {
  114.  *    Blocking, flush all buffered graphics to rasterizer and update
  115.  *    draw context.
  116.  *    
  117.  *    This function has been replaced by Q3View_Sync
  118.  }
  119. FUNCTION Q3Renderer_Sync(renderer: TQ3RendererObject; view: TQ3ViewObject): TQ3Status; C;
  120.  
  121.  
  122. {
  123.  *    Q3Renderer_IsInteractive
  124.  *        Determine if this renderer is intended to be used interactively.
  125.  }
  126. FUNCTION Q3Renderer_IsInteractive(renderer: TQ3RendererObject): TQ3Boolean; C;
  127.  
  128. {
  129.  *    Q3Renderer_HasModalConfigure
  130.  *        Determine if this renderer has a modal settings dialog.
  131.  *
  132.  *    Q3Renderer_ModalConfigure
  133.  *        Have the renderer pop up a modal dialog box to configure its settings.
  134.  *    dialogAnchor - is platform specific data passed by the client to support
  135.  *      movable modal dialogs. 
  136.  *    MacOS: this is a callback to the calling application's event handler.
  137.  *      The renderer calls this function with events not handled by the 
  138.  *      settings dialog. This is necessary in order to support movable modal 
  139.  *      dialogs. An application's event handler must return kQ3True if it 
  140.  *      handles the event passed to the callback or kQ3False if not. 
  141.  *      An application which doesn't want to support a movable modal configure
  142.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  143.  *    Win32: this is the HWND of the owning window (typically an application's
  144.  *      main window).
  145.  *  canceled - returns a boolean inditacating that the user canceled the 
  146.  *    dialog.
  147.  *      
  148.  }
  149. FUNCTION Q3Renderer_HasModalConfigure(renderer: TQ3RendererObject): TQ3Boolean; C;
  150. FUNCTION Q3Renderer_ModalConfigure(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean): TQ3Status; C;
  151. {
  152.  *    Q3RendererClass_GetNickNameString
  153.  *        Allows an application to get a renderers name string, the 
  154.  *        renderer is responsible for storing this in a localizable format
  155.  *        for example as a resource.  This string can then be used to provide
  156.  *        a selection mechanism for an application (for example in a menu).
  157.  *
  158.  *        If this call returns nil in the supplied string, then the App may 
  159.  *         choose to use the class name for the renderer.  You should always 
  160.  *        try to get the name string before using the class name, since the
  161.  *        class name is not localizable.
  162.  }
  163. FUNCTION Q3RendererClass_GetNickNameString(rendererClassType: TQ3ObjectType; VAR rendererClassString: TQ3ObjectClassNameString): TQ3Status; C;
  164.  
  165. {
  166.  *    Q3Renderer_GetConfigurationData
  167.  *        Allows an application to collect private renderer configuration data
  168.  *      which it will then save. For example in a preference file or in a 
  169.  *        style template. An application should tag this data with the 
  170.  *        Renderer's object  name.
  171.  *    
  172.  *        if dataBuffer is NULL actualDataSize returns the required size in 
  173.  *        bytes of a data buffer large enough to store private data. 
  174.  *
  175.  *      bufferSize is the actual size of the memory block pointed to by 
  176.  *        dataBuffer
  177.  *
  178.  *        actualDataSize - on return the actual number of bytes written to the 
  179.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  180.  * 
  181.  }
  182. FUNCTION Q3Renderer_GetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: LONGINT; VAR actualDataSize: LONGINT): TQ3Status; C;
  183. FUNCTION Q3Renderer_SetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: LONGINT): TQ3Status; C;
  184.  
  185.  
  186. {*****************************************************************************
  187.  **                                                                             **
  188.  **                        Interactive Renderer Specific Functions                 **
  189.  **                                                                             **
  190.  ****************************************************************************}
  191. { CSG IDs attribute }
  192. { Object IDs, to be applied as attributes on geometries }
  193. { Possible CSG equations }
  194.  
  195. TYPE
  196.     TQ3CSGEquation                 = LONGINT;
  197. CONST
  198.     kQ3CSGEquationAandB            = {TQ3CSGEquation}$88888888;
  199.     kQ3CSGEquationAandnotB        = {TQ3CSGEquation}$22222222;
  200.     kQ3CSGEquationAanBonCad        = {TQ3CSGEquation}$2F222F22;
  201.     kQ3CSGEquationnotAandB        = {TQ3CSGEquation}$44444444;
  202.     kQ3CSGEquationnAaBorCanB    = {TQ3CSGEquation}$74747474;
  203.  
  204.  
  205. TYPE
  206.     TQ3HiddenSurfaceRemovalMode  = LONGINT;
  207. CONST
  208.     kQ3HiddenSurfaceRemovalMode_None = {TQ3HiddenSurfaceRemovalMode}0;
  209.     kQ3HiddenSurfaceRemovalMode_Shallow = {TQ3HiddenSurfaceRemovalMode}1;
  210.     kQ3HiddenSurfaceRemovalMode_Deep = {TQ3HiddenSurfaceRemovalMode}2;
  211.  
  212. FUNCTION Q3InteractiveRenderer_SetCSGEquation(renderer: TQ3RendererObject; equation: TQ3CSGEquation): TQ3Status; C;
  213. FUNCTION Q3InteractiveRenderer_GetCSGEquation(renderer: TQ3RendererObject; VAR equation: TQ3CSGEquation): TQ3Status; C;
  214. FUNCTION Q3InteractiveRenderer_SetPreferences(renderer: TQ3RendererObject; vendorID: LONGINT; engineID: LONGINT): TQ3Status; C;
  215. FUNCTION Q3InteractiveRenderer_GetPreferences(renderer: TQ3RendererObject; VAR vendorID: LONGINT; VAR engineID: LONGINT): TQ3Status; C;
  216. FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass(renderer: TQ3RendererObject; bypass: TQ3Boolean): TQ3Status; C;
  217. FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass(renderer: TQ3RendererObject; VAR bypass: TQ3Boolean): TQ3Status; C;
  218. FUNCTION Q3InteractiveRenderer_SetRAVEContextHints(renderer: TQ3RendererObject; RAVEContextHints: LONGINT): TQ3Status; C;
  219. FUNCTION Q3InteractiveRenderer_GetRAVEContextHints(renderer: TQ3RendererObject; VAR RAVEContextHints: LONGINT): TQ3Status; C;
  220. FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter(renderer: TQ3RendererObject; RAVEtextureFilterValue: LONGINT): TQ3Status; C;
  221. FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter(renderer: TQ3RendererObject; VAR RAVEtextureFilterValue: LONGINT): TQ3Status; C;
  222.  
  223. {*****************************************************************************
  224.  **                                                                             **
  225.  **                            Renderer View Tools                                 **
  226.  **                                                                             **
  227.  **                    You may only call these methods from a plug-in             **
  228.  **                                                                             **
  229.  ****************************************************************************}
  230. {
  231.  *    Call by a renderer to call the user "idle" method, with progress 
  232.  *    information.
  233.  *    
  234.  *    Pass in (view, 0, n) on first call
  235.  *    Pass in (view, 1..n-1, n) during rendering
  236.  *    Pass in (view, n, n) upon completion
  237.  *    
  238.  *    Note: The user must have supplied an idleProgress method with 
  239.  *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  240.  *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  241.  *    is called instead. (current and final are ignored, essentially.)
  242.  *
  243.  *    Returns kQ3Failure if rendering is cancelled.
  244.  }
  245. FUNCTION Q3XView_IdleProgress(view: TQ3ViewObject; current: LONGINT; completed: LONGINT): TQ3Status; C;
  246. {
  247.  *    Called by an asynchronous renderer when it completes a frame.
  248.  }
  249. FUNCTION Q3XView_EndFrame(view: TQ3ViewObject): TQ3Status; C;
  250.  
  251. {*****************************************************************************
  252.  **                                                                             **
  253.  **                            Renderer AttributeSet Tools                         **
  254.  **                                                                             **
  255.  **                    You may only call these methods from a plug-in             **
  256.  **                                                                             **
  257.  ****************************************************************************}
  258. {
  259.  *    Faster access to geometry attribute sets.
  260.  *    
  261.  *    Returns pointer to INTERNAL data structure for elements and attributes
  262.  *    in an attributeSet, or NULL if no attribute exists.
  263.  *    
  264.  *    For attributes of type kQ3AttributeType..., the internal data structure
  265.  *    is identical to the data structure used in Q3AttributeSet_Add.
  266.  }
  267. FUNCTION Q3XAttributeSet_GetPointer(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): Ptr; C;
  268.  
  269.  
  270. CONST
  271.     kQ3XAttributeMaskNone        = 0;
  272.     kQ3XAttributeMaskSurfaceUV    = $01;
  273.     kQ3XAttributeMaskShadingUV    = $02;
  274.     kQ3XAttributeMaskNormal        = $04;
  275.     kQ3XAttributeMaskAmbientCoefficient = $08;
  276.     kQ3XAttributeMaskDiffuseColor = $10;
  277.     kQ3XAttributeMaskSpecularColor = $20;
  278.     kQ3XAttributeMaskSpecularControl = $40;
  279.     kQ3XAttributeMaskTransparencyColor = $80;
  280.     kQ3XAttributeMaskSurfaceTangent = $0100;
  281.     kQ3XAttributeMaskHighlightState = $0200;
  282.     kQ3XAttributeMaskSurfaceShader = $0400;
  283.     kQ3XAttributeMaskCustomAttribute = $80000000;
  284.     kQ3XAttributeMaskAll        = $800007FF;
  285.     kQ3XAttributeMaskInherited    = $03FF;
  286.     kQ3XAttributeMaskInterpolated = $01FF;
  287.  
  288.  
  289. TYPE
  290.     TQ3XAttributeMask                    = LONGINT;
  291. FUNCTION Q3XAttributeSet_GetMask(attributeSet: TQ3AttributeSet): TQ3XAttributeMask; C;
  292.  
  293. {*****************************************************************************
  294.  **                                                                             **
  295.  **                            Renderer Draw Context Tools                         **
  296.  **                                                                             **
  297.  ****************************************************************************}
  298.  
  299. TYPE
  300.     TQ3XDrawRegion = ^LONGINT;
  301. FUNCTION Q3XDrawContext_GetDrawRegion(drawContext: TQ3DrawContextObject; VAR drawRegion: TQ3XDrawRegion): TQ3Status; C;
  302.  
  303. TYPE
  304.     TQ3XDrawContextValidationMasks  = LONGINT;
  305. CONST
  306.     kQ3XDrawContextValidationClearFlags = {TQ3XDrawContextValidationMasks}$00000000;
  307.     kQ3XDrawContextValidationDoubleBuffer = {TQ3XDrawContextValidationMasks}$01;
  308.     kQ3XDrawContextValidationShader = {TQ3XDrawContextValidationMasks}$02;
  309.     kQ3XDrawContextValidationClearFunction = {TQ3XDrawContextValidationMasks}$04;
  310.     kQ3XDrawContextValidationActiveBuffer = {TQ3XDrawContextValidationMasks}$08;
  311.     kQ3XDrawContextValidationInternalOffScreen = {TQ3XDrawContextValidationMasks}$10;
  312.     kQ3XDrawContextValidationPane = {TQ3XDrawContextValidationMasks}$20;
  313.     kQ3XDrawContextValidationMask = {TQ3XDrawContextValidationMasks}$40;
  314.     kQ3XDrawContextValidationDevice = {TQ3XDrawContextValidationMasks}$80;
  315.     kQ3XDrawContextValidationWindow = {TQ3XDrawContextValidationMasks}$0100;
  316.     kQ3XDrawContextValidationWindowSize = {TQ3XDrawContextValidationMasks}$0200;
  317.     kQ3XDrawContextValidationWindowClip = {TQ3XDrawContextValidationMasks}$0400;
  318.     kQ3XDrawContextValidationWindowPosition = {TQ3XDrawContextValidationMasks}$0800;
  319.     kQ3XDrawContextValidationPlatformAttributes = {TQ3XDrawContextValidationMasks}$1000;
  320.     kQ3XDrawContextValidationForegroundShader = {TQ3XDrawContextValidationMasks}$2000;
  321.     kQ3XDrawContextValidationBackgroundShader = {TQ3XDrawContextValidationMasks}$4000;
  322.     kQ3XDrawContextValidationColorPalette = {TQ3XDrawContextValidationMasks}$8000;
  323.     kQ3XDrawContextValidationAll = {TQ3XDrawContextValidationMasks}$FFFFFFFF;
  324.  
  325.  
  326. TYPE
  327.     TQ3XDrawContextValidation            = LONGINT;
  328. FUNCTION Q3XDrawContext_ClearValidationFlags(drawContext: TQ3DrawContextObject): TQ3Status; C;
  329. FUNCTION Q3XDrawContext_GetValidationFlags(drawContext: TQ3DrawContextObject; VAR validationFlags: TQ3XDrawContextValidation): TQ3Status; C;
  330.  
  331. {*****************************************************************************
  332.  **                                                                             **
  333.  **                            Renderer Draw Region Tools                         **
  334.  **                                                                             **
  335.  ****************************************************************************}
  336.  
  337. TYPE
  338.     TQ3XDevicePixelType         = LONGINT;
  339. CONST
  340.                                                                 {  These do not indicate byte ordering    }
  341.     kQ3XDevicePixelTypeInvalid    = {TQ3XDevicePixelType}0;        {  Unknown, un-initialized type      }
  342.     kQ3XDevicePixelTypeRGB32    = {TQ3XDevicePixelType}1;        {  Alpha:8 (ignored), R:8, G:8, B:8  }
  343.     kQ3XDevicePixelTypeARGB32    = {TQ3XDevicePixelType}2;        {  Alpha:8, R:8, G:8, B:8               }
  344.     kQ3XDevicePixelTypeRGB24    = {TQ3XDevicePixelType}3;        {  24 bits/pixel, R:8, G:8, B:8      }
  345.     kQ3XDevicePixelTypeRGB16    = {TQ3XDevicePixelType}4;        {  Alpha:1 (ignored), R:5, G:5, B:5  }
  346.     kQ3XDevicePixelTypeARGB16    = {TQ3XDevicePixelType}5;        {  Alpha:1, R:5, G:5, B:5               }
  347.     kQ3XDevicePixelTypeRGB16_565 = {TQ3XDevicePixelType}6;        {  16 bits/pixel, R:5, G:6, B:5      }
  348.     kQ3XDevicePixelTypeIndexed8    = {TQ3XDevicePixelType}7;        {  8-bit color table index              }
  349.     kQ3XDevicePixelTypeIndexed4    = {TQ3XDevicePixelType}8;        {  4-bit color table index              }
  350.     kQ3XDevicePixelTypeIndexed2    = {TQ3XDevicePixelType}9;        {  2-bit color table index              }
  351.     kQ3XDevicePixelTypeIndexed1    = {TQ3XDevicePixelType}10;        {  1-bit color table index              }
  352.  
  353.  
  354. TYPE
  355.     TQ3XClipMaskState             = LONGINT;
  356. CONST
  357.     kQ3XClipMaskFullyExposed    = {TQ3XClipMaskState}0;
  358.     kQ3XClipMaskPartiallyExposed = {TQ3XClipMaskState}1;
  359.     kQ3XClipMaskNotExposed        = {TQ3XClipMaskState}2;
  360.  
  361.  
  362. TYPE
  363.     TQ3XColorDescriptorPtr = ^TQ3XColorDescriptor;
  364.     TQ3XColorDescriptor = RECORD
  365.         redShift:                LONGINT;
  366.         redMask:                LONGINT;
  367.         greenShift:                LONGINT;
  368.         greenMask:                LONGINT;
  369.         blueShift:                LONGINT;
  370.         blueMask:                LONGINT;
  371.         alphaShift:                LONGINT;
  372.         alphaMask:                LONGINT;
  373.     END;
  374.  
  375.     TQ3XDrawRegionDescriptorPtr = ^TQ3XDrawRegionDescriptor;
  376.     TQ3XDrawRegionDescriptor = RECORD
  377.         width:                    LONGINT;
  378.         height:                    LONGINT;
  379.         rowBytes:                LONGINT;
  380.         pixelSize:                LONGINT;
  381.         pixelType:                TQ3XDevicePixelType;
  382.         colorDescriptor:        TQ3XColorDescriptor;
  383.         bitOrder:                TQ3Endian;
  384.         byteOrder:                TQ3Endian;
  385.         clipMask:                TQ3BitmapPtr;
  386.     END;
  387.  
  388.     TQ3XDrawRegionServicesMasks  = LONGINT;
  389. CONST
  390.     kQ3XDrawRegionServicesNoneFlag = {TQ3XDrawRegionServicesMasks}0;
  391.     kQ3XDrawRegionServicesClearFlag = {TQ3XDrawRegionServicesMasks}$01;
  392.     kQ3XDrawRegionServicesDontLockDDSurfaceFlag = {TQ3XDrawRegionServicesMasks}$02;
  393.  
  394.  
  395. TYPE
  396.     TQ3XDrawRegionServices                = LONGINT;
  397.     TQ3XDrawRegionRendererPrivateDeleteMethod = ProcPtr;  { PROCEDURE TQ3XDrawRegionRendererPrivateDeleteMethod(rendererPrivate: UNIV Ptr); C; }
  398.  
  399. FUNCTION Q3XDrawRegion_GetDeviceScaleX(drawRegion: TQ3XDrawRegion; VAR deviceScaleX: Single): TQ3Status; C;
  400. FUNCTION Q3XDrawRegion_GetDeviceScaleY(drawRegion: TQ3XDrawRegion; VAR deviceScaleY: Single): TQ3Status; C;
  401.  
  402. FUNCTION Q3XDrawRegion_GetDeviceOffsetX(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  403. FUNCTION Q3XDrawRegion_GetDeviceOffsetY(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  404.  
  405. FUNCTION Q3XDrawRegion_GetWindowScaleX(drawRegion: TQ3XDrawRegion; VAR windowScaleX: Single): TQ3Status; C;
  406. FUNCTION Q3XDrawRegion_GetWindowScaleY(drawRegion: TQ3XDrawRegion; VAR windowScaleY: Single): TQ3Status; C;
  407.  
  408. FUNCTION Q3XDrawRegion_GetWindowOffsetX(drawRegion: TQ3XDrawRegion; VAR windowOffsetX: Single): TQ3Status; C;
  409. FUNCTION Q3XDrawRegion_GetWindowOffsetY(drawRegion: TQ3XDrawRegion; VAR windowOffsetY: Single): TQ3Status; C;
  410. FUNCTION Q3XDrawRegion_IsActive(drawRegion: TQ3XDrawRegion; VAR isActive: TQ3Boolean): TQ3Status; C;
  411.  
  412. FUNCTION Q3XDrawRegion_GetNextRegion(drawRegion: TQ3XDrawRegion; VAR nextDrawRegion: TQ3XDrawRegion): TQ3Status; C;
  413.  *  One of the next two functions must be called before using a draw region 
  414.  }
  415. {
  416.  *    Use this Start function if double buffering/image access services from the
  417.  *    Draw Context are not needed, you may still request clear for example
  418.  }
  419. FUNCTION Q3XDrawRegion_Start(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr): TQ3Status; C;
  420. {
  421.  *    Use this Start function if double buffering or image access services from 
  422.  *  the Draw Context are needed.
  423.  }
  424. FUNCTION Q3XDrawRegion_StartAccessToImageBuffer(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr; VAR image: UNIV Ptr): TQ3Status; C;
  425. {
  426.  *    This function is used to indicate that access to a DrawRegion is ended.
  427.  }
  428. FUNCTION Q3XDrawRegion_End(drawRegion: TQ3XDrawRegion): TQ3Status; C;
  429. FUNCTION Q3XDrawRegion_GetDeviceTransform(drawRegion: TQ3XDrawRegion; VAR deviceTransform: TQ3Matrix4x4Ptr): TQ3Status; C;
  430. FUNCTION Q3XDrawRegion_GetClipFlags(drawRegion: TQ3XDrawRegion; VAR clipMaskState: TQ3XClipMaskState): TQ3Status; C;
  431. FUNCTION Q3XDrawRegion_GetClipMask(drawRegion: TQ3XDrawRegion; VAR clipMask: TQ3BitmapPtr): TQ3Status; C;
  432. {$IFC TARGET_OS_MAC }
  433. FUNCTION Q3XDrawRegion_GetClipRegion(drawRegion: TQ3XDrawRegion; VAR rgnHandle: RgnHandle): TQ3Status; C;
  434. FUNCTION Q3XDrawRegion_GetGDHandle(drawRegion: TQ3XDrawRegion; VAR gdHandle: GDHandle): TQ3Status; C;
  435. {$ENDC}  {TARGET_OS_MAC}
  436.  
  437. FUNCTION Q3XDrawRegion_GetRendererPrivate(drawRegion: TQ3XDrawRegion; VAR rendererPrivate: UNIV Ptr): TQ3Status; C;
  438. FUNCTION Q3XDrawRegion_SetRendererPrivate(drawRegion: TQ3XDrawRegion; rendererPrivate: UNIV Ptr; deleteMethod: TQ3XDrawRegionRendererPrivateDeleteMethod): TQ3Status; C;
  439. FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; flag: TQ3Boolean): TQ3Status; C;
  440. FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; VAR useDefaultRenderingFlag: TQ3Boolean): TQ3Status; C;
  441.  
  442.  
  443. {*****************************************************************************
  444.  **                                                                             **
  445.  **                            Renderer Class Methods                             **
  446.  **                                                                             **
  447.  ****************************************************************************}
  448. {
  449.  *    Methods from Object
  450.  *        kQ3XMethodTypeObjectClassRegister
  451.  *        kQ3XMethodTypeObjectClassUnregister
  452.  *        kQ3XMethodTypeObjectNew
  453.  *        kQ3XMethodTypeObjectDelete
  454.  *        kQ3XMethodTypeObjectRead
  455.  *        kQ3XMethodTypeObjectTraverse
  456.  *        kQ3XMethodTypeObjectWrite
  457.  *        
  458.  *    Methods from Shared
  459.  *        kQ3MethodTypeSharedEdited
  460.  *
  461.  *    Renderer Methods
  462.  *    
  463.  *    The renderer methods should be implemented according to the type
  464.  *    of renderer being written.
  465.  *
  466.  *    For the purposes of documentation, there are two basic types of
  467.  *    renderers: 
  468.  *
  469.  *        Interactive
  470.  *            Interactive Renderer
  471.  *            WireFrame Renderer
  472.  *        
  473.  *        Deferred
  474.  *            a ray-tracer
  475.  *            painter's algorithm renderer (cached in a BSP triangle tree)
  476.  *            an artistic renderer (simulates a pencil drawing, etc.)
  477.  *
  478.  *    The main difference is how each renderer handles incoming state and 
  479.  *    geometry.
  480.  *
  481.  *    An interactive renderer immediately transforms, culls, and shades
  482.  *    incoming geometry and performs rasterization. For example, in a 
  483.  *    single-buffered WireFrame renderer, you will see a new triangle
  484.  *    immediately after Q3Triangle_Draw (if it's visible, of course).
  485.  *
  486.  *    A deferred renderer caches the view state and each geometry, 
  487.  *    converting into any internal queue of drawing commands. Rasterization
  488.  *    is not actually performed until all data has been submitted.
  489.  *    
  490.  *    For example, a ray-tracer may not rasterize anything until the
  491.  *    end of the rendering loop, or until an EndFrame call is made.
  492.  }
  493.  
  494. {*****************************************************************************
  495.  **                                                                             **
  496.  **                        Renderer User Interface Methods                         **
  497.  **                                                                             **
  498.  ****************************************************************************}
  499. {
  500.  *    kQ3XMethodTypeRendererIsInteractive
  501.  *    
  502.  *    There is no actual method with this - the metahandler simply returns
  503.  *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  504.  *  intended to be used in interactive settings, and   
  505.  *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  506.  *  
  507.  *  If neither value is specified in the metahandler, the renderer 
  508.  *  is *assumed to be non-interactive*!!!
  509.  *    
  510.  *    OPTIONAL
  511.  }
  512.  
  513. CONST
  514.     kQ3XMethodTypeRendererIsInteractive = 'isin';
  515.  
  516.  
  517. {
  518.  *    TQ3XRendererModalConfigureMethod
  519.  *    
  520.  *    This method should pop up a modal dialog to edit the renderer settings 
  521.  *    found in the renderer private. 
  522.  *    
  523.  *    dialogAnchor - is platform specific data passed by the client to support
  524.  *      movable modal dialogs. 
  525.  *    MacOS: this is a callback to the calling application's event handler.
  526.  *      The renderer calls this function with events not handled by the 
  527.  *      settings dialog. This is necessary in order to support movable modal 
  528.  *      dialogs. An application's event handler must return kQ3True if it 
  529.  *      handles the event passed to the callback or kQ3False if not. 
  530.  *      An application which doesn't want to support a movable modal configure
  531.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  532.  *      A renderer should implement a non-movable style dialog in that case.
  533.  *    Win32: this is the HWND of the owning window (typically an application's
  534.  *      main window).  (Win32 application modal dialogs are always movable.)
  535.  *  canceled - returns a boolean inditacating that the user canceled the 
  536.  *    dialog.
  537.  *    
  538.  *    OPTIONAL
  539.  }
  540.     kQ3XMethodTypeRendererModalConfigure = 'rdmc';
  541.  
  542.  
  543. TYPE
  544.     TQ3XRendererModalConfigureMethod = ProcPtr;  { FUNCTION TQ3XRendererModalConfigureMethod(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean; rendererPrivate: UNIV Ptr): TQ3Status; C; }
  545.  
  546. {
  547.  *    kQ3XMethodTypeRendererGetNickNameString
  548.  *    
  549.  *        Allows an application to collect the name of the renderer for
  550.  *        display in a user interface item such as a menu.
  551.  *    
  552.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  553.  *        bytes of a data buffer large enough to store the renderer name. 
  554.  *
  555.  *      bufferSize is the actual size of the memory block pointed to by 
  556.  *        dataBuffer
  557.  *
  558.  *        actualDataSize - on return the actual number of bytes written to the
  559.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  560.  *
  561.  *    OPTIONAL
  562.  }
  563.  
  564. CONST
  565.     kQ3XMethodTypeRendererGetNickNameString = 'rdns';
  566.  
  567.  
  568. TYPE
  569.     TQ3XRendererGetNickNameStringMethod = ProcPtr;  { FUNCTION TQ3XRendererGetNickNameStringMethod(VAR dataBuffer: UInt8; bufferSize: LONGINT; VAR actualDataSize: LONGINT): TQ3Status; C; }
  570.  
  571. {
  572.  *    kQ3XMethodTypeRendererGetConfigurationData
  573.  *    
  574.  *        Allows an application to collect private configuration data from the
  575.  *      renderer which it will then save. For example in a preference file, 
  576.  *      a registry key (on Windows) or in a style template. An application 
  577.  *      should tag this data with the renderer's object name.
  578.  *    
  579.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  580.  *        bytes of a data buffer large enough to store private data. 
  581.  *
  582.  *      bufferSize is the actual size of the memory block pointed to by 
  583.  *        dataBuffer
  584.  *
  585.  *        actualDataSize - on return the actual number of bytes written to the
  586.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  587.  *
  588.  *    OPTIONAL
  589.  }
  590.  
  591. CONST
  592.     kQ3XMethodTypeRendererGetConfigurationData = 'rdgp';
  593.  
  594.  
  595. TYPE
  596.     TQ3XRendererGetConfigurationDataMethod = ProcPtr;  { FUNCTION TQ3XRendererGetConfigurationDataMethod(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: LONGINT; VAR actualDataSize: LONGINT; rendererPrivate: UNIV Ptr): TQ3Status; C; }
  597.  
  598. {
  599.  *    TQ3XRendererSetConfigurationDataMethod
  600.  *    
  601.  *        Allows an application to pass private configuration data which has
  602.  *         previously  been obtained from a renderer via 
  603.  *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  604.  *        in a style template. An application should tag this data with the 
  605.  *        renderer's object name.
  606.  *    
  607.  *      bufferSize is the actual size of the memory block pointed to by 
  608.  *        dataBuffer
  609.  *
  610.  *    OPTIONAL
  611.  }
  612.  
  613. CONST
  614.     kQ3XMethodTypeRendererSetConfigurationData = 'rdsp';
  615.  
  616.  
  617. TYPE
  618.     TQ3XRendererSetConfigurationDataMethod = ProcPtr;  { FUNCTION TQ3XRendererSetConfigurationDataMethod(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: LONGINT; rendererPrivate: UNIV Ptr): TQ3Status; C; }
  619.  
  620. {*****************************************************************************
  621.  **                                                                             **
  622.  **                        Renderer Drawing State Methods                         **
  623.  **                                                                             **
  624.  ****************************************************************************}
  625. {
  626.  *    TQ3RendererStartFrame
  627.  *    
  628.  *    The StartFrame method is called first at Q3View_StartRendering
  629.  *    and should:
  630.  *        - initialize any renderer state to defaults
  631.  *        - extract any and all useful data from the drawContext
  632.  *
  633.  *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  634.  *    registration, then it should also:
  635.  *        - clear the drawContext 
  636.  *    
  637.  *        When clearing, your renderer may opt to:
  638.  *        - NOT clear anything (if you touch every pixel, for example)
  639.  *        - to clear with your own routine, or
  640.  *        - to use the draw context default clear method by calling 
  641.  *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  642.  *        any available hardware in the system for clearing.
  643.  *    
  644.  *    This call also signals the start of all default submit commands from
  645.  *    the view. The renderer will receive updates for the default view
  646.  *    state via its Update methods before StartPass is called.
  647.  *    
  648.  *    REQUIRED
  649.  }
  650.  
  651. CONST
  652.     kQ3XMethodTypeRendererStartFrame = 'rdcl';
  653.  
  654.  
  655. TYPE
  656.     TQ3XRendererStartFrameMethod = ProcPtr;  { FUNCTION TQ3XRendererStartFrameMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C; }
  657.  
  658. {
  659.  *    kQ3XMethodTypeRendererStartPass
  660.  *    TQ3XRendererStartPassMethod
  661.  *    
  662.  *    The StartPass method is called during Q3View_StartRendering but after
  663.  *    the StartFrame command. It should:
  664.  *        - collect camera and light information
  665.  *    
  666.  *    If your renderer supports deferred camera transformation, camera is the
  667.  *    main camera which will be submitted in the hierarchy somewhere. It
  668.  *    is never NULL.
  669.  *
  670.  *    If your renderer does not support deferred camera transformation, camera
  671.  *    is the transformed camera.
  672.  *
  673.  *    If your renderer supports deferred light transformation, lights will be
  674.  *    NULL, and will be submitted to your light draw methods instead.
  675.  *
  676.  *    This call signals the end of the default update state, and the start of 
  677.  *  submit commands from the user to the view.
  678.  *
  679.  *    REQUIRED
  680.  }
  681.  
  682. CONST
  683.     kQ3XMethodTypeRendererStartPass = 'rdst';
  684.  
  685.  
  686. TYPE
  687.     TQ3XRendererStartPassMethod = ProcPtr;  { FUNCTION TQ3XRendererStartPassMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; lightGroup: TQ3GroupObject): TQ3Status; C; }
  688.  
  689. {
  690.  *    kQ3XMethodTypeRendererFlushFrame
  691.  *    TQ3XRendererFlushFrameMethod
  692.  *    
  693.  *    This call is only implemented by asynchronous renderers.
  694.  *    
  695.  *    The FlushFrame method is called between the StartPass and EndPass
  696.  *    methods and is called when the user wishes to flush any asynchronous
  697.  *    drawing tasks (which draw to the drawcontext), but does not want 
  698.  *    to block.
  699.  *    
  700.  *    The result of this call is that an image should "eventually" appear
  701.  *    asynchronously.
  702.  *    
  703.  *    For asynchronous rendering, this call is non-blocking.
  704.  *    
  705.  *    An interactive renderer should ensure that all received
  706.  *    geometries are drawn in the image.
  707.  *    
  708.  *    An interactive renderer that talks to hardware should force
  709.  *    the hardware to generate an image.
  710.  *    
  711.  *    A deferred renderer should exhibit a similar behaviour,
  712.  *    though it is not required.  A deferred renderer should spawn
  713.  *    a process that generates a partial image from the currently
  714.  *    accumulated drawing state. 
  715.  *    
  716.  *    However, for renderers such as ray-tracers which generally are
  717.  *    quite compute-intensive, FlushFrame is not required and is a no-op.
  718.  *
  719.  *    OPTIONAL
  720.  }
  721.  
  722. CONST
  723.     kQ3XMethodTypeRendererFlushFrame = 'rdfl';
  724.  
  725.  
  726. TYPE
  727.     TQ3XRendererFlushFrameMethod = ProcPtr;  { FUNCTION TQ3XRendererFlushFrameMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C; }
  728.  
  729. {
  730.  *    kQ3XMethodTypeRendererEndPass
  731.  *    TQ3XRendererEndPassMethod
  732.  *    
  733.  *    The EndPass method is called at Q3View_EndRendering and signals
  734.  *    the end of submit commands to the view.
  735.  *
  736.  *    If an error occurs, the renderer should call Q3XError_Post and
  737.  *    return kQ3ViewStatusError.
  738.  *    
  739.  *    If a renderer requires another pass on the renderering data,
  740.  *    it should return kQ3ViewStatusRetraverse.
  741.  *    
  742.  *    If rendering was cancelled, this function will not be called
  743.  *    and the view will handle returning kQ3ViewStatusCancelled;
  744.  *    
  745.  *    Otherwise, your renderer should begin completing the process of 
  746.  *    generating the image in the drawcontext. If you have buffered
  747.  *    any drawing data, flush it. RendererEnd should have a similar
  748.  *    effect as RendererFlushFrame.
  749.  *    
  750.  *    If the renderer is synchronous:
  751.  *        - complete rendering of the entire frame
  752.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  753.  *            - Update the front buffer
  754.  *        else
  755.  *            - DrawContext will update the front buffer after returning
  756.  *
  757.  *    If the renderer is asynchronous
  758.  *        - spawn rendering thread for entire frame
  759.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  760.  *            - you must eventually update the front buffer asynchronously
  761.  *        else
  762.  *            - you must eventually update the back buffer asynchronously
  763.  *            
  764.  *    REQUIRED
  765.  }
  766.  
  767. CONST
  768.     kQ3XMethodTypeRendererEndPass = 'rded';
  769.  
  770.  
  771. TYPE
  772.     TQ3XRendererEndPassMethod = ProcPtr;  { FUNCTION TQ3XRendererEndPassMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3ViewStatus; C; }
  773.  
  774. {
  775.  *    kQ3XMethodTypeRendererEndFrame
  776.  *    TQ3XRendererEndFrame
  777.  *    
  778.  *    This call is only implemented by asynchronous renderers.
  779.  *
  780.  *    The EndFrame method is called from Q3View_Sync, which is
  781.  *    called after Q3View_EndRendering and signals that the user
  782.  *    wishes to see the completed image and is willing to block.
  783.  *    
  784.  *    If your renderer supports kQ3RendererFlagDoubleBuffer
  785.  *        - update the front buffer completely 
  786.  *    else
  787.  *        - update the back buffer completely
  788.  *
  789.  *    This call is equivalent in functionality to RendererFlushFrame
  790.  *    but blocks until the image is completed.
  791.  *    
  792.  *    If no method is supplied, the default is a no-op.
  793.  *    
  794.  *    NOTE: Registering a method of this type indicates that your renderer will
  795.  *    be rendering after Q3View_EndRendering has been called.
  796.  *    
  797.  *    OPTIONAL
  798.  }
  799.  
  800. CONST
  801.     kQ3XMethodTypeRendererEndFrame = 'rdsy';
  802.  
  803.  
  804. TYPE
  805.     TQ3XRendererEndFrameMethod = ProcPtr;  { FUNCTION TQ3XRendererEndFrameMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C; }
  806.  
  807. {
  808.  *    The RendererCancel method is called after Q3View_StartRendering
  809.  *    and signals the termination of all rendering operations.
  810.  *
  811.  *    A renderer should clean up any cached data, and cancel all 
  812.  *    rendering operations.
  813.  *    
  814.  *    If called before Q3View_EndRendering, the RendererEnd method
  815.  *    is NOT called.
  816.  *    
  817.  *    If called after Q3View_EndRendering, the renderer should kill
  818.  *    any threads and terminate any further rendering.
  819.  *    
  820.  *    REQUIRED
  821.  }
  822.  
  823. CONST
  824.     kQ3XMethodTypeRendererCancel = 'rdab';
  825.  
  826.  
  827. TYPE
  828.     TQ3XRendererCancelMethod = ProcPtr;  { PROCEDURE TQ3XRendererCancelMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr); C; }
  829.  
  830. {*****************************************************************************
  831.  **                                                                             **
  832.  **                        Renderer DrawContext Methods                         **
  833.  **                                                                             **
  834.  ****************************************************************************}
  835. {
  836.  *    kQ3XMethodTypeRendererPush
  837.  *    TQ3XRendererPushMethod
  838.  *    
  839.  *    kQ3XMethodTypeRendererPop
  840.  *    TQ3XRendererPopMethod
  841.  *    
  842.  *    These methods are called whenever the graphics state in the view
  843.  *    is pushed or popped. The user may isolate state by calling:
  844.  *    
  845.  *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  846.  *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  847.  *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  848.  *    Q3Box_Submit(&unitBox, view);
  849.  *    Q3TranslateTransform_Submit(&unitVector, view);
  850.  *    Q3Push_Submit(view);
  851.  *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  852.  *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  853.  *        Q3Box_Submit(&unitBox, view);
  854.  *    Q3Pop_Submit(view);    
  855.  *    Q3TranslateTransform_Submit(&unitVector, view);
  856.  *    Q3Box_Submit(&unitBox, view);
  857.  *    
  858.  *    or by submitting a display group which pushes and pops.
  859.  *    
  860.  *    If you support RendererPush and RendererPop in your renderer:
  861.  *        - you must maintain your drawing state as a stack, as well.
  862.  *        - you will not be updated with the popped state after
  863.  *            RendererPop is called.
  864.  *
  865.  *    If you do not support Push and Pop in your renderer:
  866.  *        - you may maintain a single copy of the drawing state.
  867.  *        - you will be updated with changed fields after the view stack is
  868.  *            popped.
  869.  *
  870.  *    A renderer that supports Push and Pop gets called in the following
  871.  *    sequence (from example above):
  872.  *    
  873.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  874.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  875.  *    RendererUpdateAttributeSpecularColor(&white,...)
  876.  *    RendererUpdateMatrixLocalToWorld(...)
  877.  *    RendererSubmitGeometryBox(...)
  878.  *    RendererPush(...)
  879.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  880.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  881.  *        RendererSubmitGeometryBox(...)
  882.  *    RendererPop(...)
  883.  *    RendererUpdateMatrixLocalToWorld(...)
  884.  *    RendererSubmitGeometryBox(...)
  885.  *
  886.  *    A renderer that does not supports Push and Pop gets called in the
  887.  *    following sequence:
  888.  *    
  889.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  890.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  891.  *    RendererUpdateAttributeSpecularColor(&white,...)
  892.  *    RendererUpdateMatrixLocalToWorld(...)
  893.  *    RendererSubmitGeometryBox(...)
  894.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  895.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  896.  *        RendererSubmitGeometryBox(...)
  897.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  898.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  899.  *    RendererUpdateMatrixLocalToWorld(...)
  900.  *    RendererSubmitGeometryBox(...)
  901.  *    
  902.  }
  903.  
  904. CONST
  905.     kQ3XMethodTypeRendererPush    = 'rdps';
  906.  
  907.  
  908. TYPE
  909.     TQ3XRendererPushMethod = ProcPtr;  { FUNCTION TQ3XRendererPushMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C; }
  910.  
  911.  
  912. CONST
  913.     kQ3XMethodTypeRendererPop    = 'rdpo';
  914.  
  915.  
  916. TYPE
  917.     TQ3XRendererPopMethod = ProcPtr;  { FUNCTION TQ3XRendererPopMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C; }
  918.  
  919. {*****************************************************************************
  920.  **                                                                             **
  921.  **                            Renderer Cull Methods                             **
  922.  **                                                                             **
  923.  ****************************************************************************}
  924. {
  925.  *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  926.  *    TQ3XRendererIsBoundingBoxVisibleMethod
  927.  *    
  928.  *    This method is called to cull complex groups and geometries 
  929.  *    given their bounding box in local space.
  930.  *    
  931.  *    It should transform the local-space bounding box coordinates to
  932.  *    frustum space and return a TQ3Boolean return value indicating
  933.  *    whether the box appears within the viewing frustum.
  934.  *    
  935.  *    If no method is supplied, the default behavior is to return
  936.  *    kQ3True.
  937.  *    
  938.  }
  939.  
  940. CONST
  941.     kQ3XMethodTypeRendererIsBoundingBoxVisible = 'rdbx';
  942.  
  943.  
  944. TYPE
  945.     TQ3XRendererIsBoundingBoxVisibleMethod = ProcPtr;  { FUNCTION TQ3XRendererIsBoundingBoxVisibleMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; (CONST)VAR bBox: TQ3BoundingBox): TQ3Boolean; C; }
  946.  
  947.  
  948. {*****************************************************************************
  949.  **                                                                             **
  950.  **                        Renderer Object Support Methods                         **
  951.  **                                                                             **
  952.  ****************************************************************************}
  953. {
  954.  *    Drawing methods (Geometry, Camera, Lights)
  955.  *
  956.  }
  957. {
  958.  *    Geometry MetaHandler
  959.  *    
  960.  *    This metaHandler is required to support 
  961.  *    
  962.  *    kQ3GeometryTypeTriangle
  963.  *    kQ3GeometryTypeLine
  964.  *    kQ3GeometryTypePoint
  965.  *    kQ3GeometryTypeMarker
  966.  *    kQ3GeometryTypePixmapMarker
  967.  *    
  968.  *    REQUIRED
  969.  }
  970.  
  971. CONST
  972.     kQ3XMethodTypeRendererSubmitGeometryMetaHandler = 'rdgm';
  973.  
  974.  
  975. TYPE
  976.     TQ3XRendererSubmitGeometryMetaHandlerMethod = ProcPtr;  { FUNCTION TQ3XRendererSubmitGeometryMetaHandlerMethod(geometryType: TQ3ObjectType): TQ3XFunctionPointer; C; }
  977.  
  978. {
  979.  *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  980.  *    of kQ3GeometryTypeFoo and returns methods of type:
  981.  }
  982.     TQ3XRendererSubmitGeometryMethod = ProcPtr;  { FUNCTION TQ3XRendererSubmitGeometryMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; geometry: TQ3GeometryObject; publicData: UNIV Ptr): TQ3Status; C; }
  983.  
  984. {
  985.  *    Camera MetaHandler
  986.  *    
  987.  *    This metaHandler, if supplied, indicates that your renderer
  988.  *    handles deferred transformation of the main camera within a scene.
  989.  *    
  990.  *    If not supplied, or an unsupported camera is used, the view will do
  991.  *    the transformation for the renderer and pass in a camera in the 
  992.  *    StartPass method.
  993.  *    
  994.  *    OPTIONAL
  995.  }
  996.  
  997. CONST
  998.     kQ3XMethodTypeRendererSubmitCameraMetaHandler = 'rdcm';
  999.  
  1000.  
  1001. TYPE
  1002.     TQ3XRendererSubmitCameraMetaHandlerMethod = ProcPtr;  { FUNCTION TQ3XRendererSubmitCameraMetaHandlerMethod(cameraType: TQ3ObjectType): TQ3XFunctionPointer; C; }
  1003.  
  1004. {
  1005.  *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1006.  *    of kQ3CameraTypeFoo and returns methods of type:
  1007.  }
  1008.     TQ3XRendererSubmitCameraMethod = ProcPtr;  { FUNCTION TQ3XRendererSubmitCameraMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; publicData: UNIV Ptr): TQ3Status; C; }
  1009.  
  1010. {
  1011.  *    Light MetaHandler
  1012.  *    
  1013.  *    This metaHandler, if supplied, indicates that your renderer
  1014.  *    handles deferred transformation of lights within a scene.
  1015.  *    
  1016.  *    If an unsupported light is encountered, it is ignored.
  1017.  *
  1018.  *    OPTIONAL
  1019.  }
  1020.  
  1021. CONST
  1022.     kQ3XMethodTypeRendererSubmitLightMetaHandler = 'rdlg';
  1023.  
  1024.  
  1025. TYPE
  1026.     TQ3XRendererSubmitLightMetaHandlerMethod = ProcPtr;  { FUNCTION TQ3XRendererSubmitLightMetaHandlerMethod(lightType: TQ3ObjectType): TQ3XFunctionPointer; C; }
  1027.  
  1028. {
  1029.  *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1030.  *    of kQ3LightTypeFoo and returns methods of type:
  1031.  }
  1032.     TQ3XRendererSubmitLightMethod = ProcPtr;  { FUNCTION TQ3XRendererSubmitLightMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; light: TQ3LightObject; publicData: UNIV Ptr): TQ3Status; C; }
  1033.  
  1034. {
  1035.  *
  1036.  *    Update methods
  1037.  *
  1038.  *    They are called whenever the state has changed. If the renderer supports
  1039.  *    the RendererPush and RendererPop methods, it must maintain its own state
  1040.  *    stack. Updates are not called for changed data when the view stack is
  1041.  *    popped.
  1042.  *
  1043.  *    See the comments for the RendererPush and RendererPop methods above
  1044.  *    for an example of how data is updated.
  1045.  *
  1046.  }
  1047. {
  1048.  *    Style
  1049.  }
  1050.  
  1051. CONST
  1052.     kQ3XMethodTypeRendererUpdateStyleMetaHandler = 'rdyu';
  1053.  
  1054.  
  1055. TYPE
  1056.     TQ3XRendererUpdateStyleMetaHandlerMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateStyleMetaHandlerMethod(styleType: TQ3ObjectType): TQ3XFunctionPointer; C; }
  1057.  
  1058. {
  1059.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1060.  *    of kQ3StyleTypeFoo and returns methods of type:
  1061.  }
  1062.     TQ3XRendererUpdateStyleMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateStyleMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C; }
  1063.  
  1064. {
  1065.  *    Attributes
  1066.  }
  1067.  
  1068. CONST
  1069.     kQ3XMethodTypeRendererUpdateAttributeMetaHandler = 'rdau';
  1070.  
  1071.  
  1072. TYPE
  1073.     TQ3XRendererUpdateAttributeMetaHandlerMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateAttributeMetaHandlerMethod(attributeType: TQ3AttributeType): TQ3XFunctionPointer; C; }
  1074.  
  1075. {
  1076.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1077.  *    of kQ3AttributeTypeFoo and returns methods of type:
  1078.  }
  1079.     TQ3XRendererUpdateAttributeMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateAttributeMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C; }
  1080.  
  1081. {
  1082.  *    Shaders
  1083.  }
  1084.  
  1085. CONST
  1086.     kQ3XMethodTypeRendererUpdateShaderMetaHandler = 'rdsu';
  1087.  
  1088.  
  1089. TYPE
  1090.     TQ3XRendererUpdateShaderMetaHandlerMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateShaderMetaHandlerMethod(shaderType: TQ3ObjectType): TQ3XFunctionPointer; C; }
  1091.  
  1092. {
  1093.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1094.  *    of kQ3ShaderTypeFoo and returns methods of type:
  1095.  }
  1096.     TQ3XRendererUpdateShaderMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateShaderMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; shaderObject: TQ3Object): TQ3Status; C; }
  1097.  
  1098. {
  1099.  *    Matrices
  1100.  }
  1101.  
  1102. CONST
  1103.     kQ3XMethodTypeRendererUpdateMatrixMetaHandler = 'rdxu';
  1104.  
  1105.  
  1106. TYPE
  1107.     TQ3XRendererUpdateMatrixMetaHandlerMethod = TQ3XMetaHandler;
  1108. {
  1109.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1110.  *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1111.  }
  1112.  
  1113. CONST
  1114.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorld = 'ulwx';
  1115.  
  1116.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse = 'ulwi';
  1117.  
  1118.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose = 'ulwt';
  1119.  
  1120.     kQ3XMethodTypeRendererUpdateMatrixLocalToCamera = 'ulcx';
  1121.  
  1122.     kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum = 'ulfx';
  1123.  
  1124.     kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum = 'uwfx';
  1125.  
  1126. {
  1127.  *    and returns methods of type:
  1128.  }
  1129.  
  1130. TYPE
  1131.     TQ3XRendererUpdateMatrixMethod = ProcPtr;  { FUNCTION TQ3XRendererUpdateMatrixMethod(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; (CONST)VAR matrix: TQ3Matrix4x4): TQ3Status; C; }
  1132.  
  1133.  
  1134. {$ALIGN RESET}
  1135. {$POP}
  1136.  
  1137. {$SETC UsingIncludes := QD3DRendererIncludes}
  1138.  
  1139. {$ENDC} {__QD3DRENDERER__}
  1140.  
  1141. {$IFC NOT UsingIncludes}
  1142.  END.
  1143. {$ENDC}
  1144.